/// \file owl_parser.h.
///============================================================================\n
/// Name        : owl_parser.h\n
/// Author      : Gergely Lukacsy (info@dlog-reasoner.org)\n
/// Version     : 0.01\n
/// Copyright   : DERI\n
/// Description : OWL 2 XML parser, header file.\n
/// 
/// This file is part of the DParser and DLog 2 projects.\n
///============================================================================

#ifndef OWL_PARSER_H_
#define OWL_PARSER_H_


/// Class for SAX parsing OWL2 XML ontologies.
class OWLPARSER {
friend class OWLHANDLER;
public:
	/// Constructor.
	/// @param pFileName is the name of the file holding the OWL 2 XML ontology.
	/// @param bValidate is a bool describing whether the parser should validate the input or not.
	explicit OWLPARSER(char* pFileName, bool bValidate, SROIQKB* pKB);
	
	/// Destructor.
	~OWLPARSER();

	/// Entry function to parse a given file.
	void parseOWL();

	/// Return the number of unparsed elements.
	DWORD getNrUnparsedElements();

private:
	/// This contains the structured representation of the Ontology.
	SROIQKB* pKnowledgeBase;

	/// This is the stack we use during the SAX parsing.
	STACK<SROIQTERM*> mStack;

	/// Name of the file that contains the ontology.
	char* pFile;

	/// Validation bit.
	bool bValidate;

	/// Number of unknown elements during parsing.
	DWORD nrUnknownElements;
};

#endif /* OWL_PARSER_H_ */
